<?php
/**
 * @version		$Id: mybirt.php 2011.08.11 thierry $
 * @package		site.models
 * @subpackage	com_projid
 * @copyright	Copyright (C) 2011 Pojid All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die('Restricted access');

 // import joomla controller library
jimport('joomla.application.component.controller');

require_once('config.php');
require_once('mydb.php');
require_once('mypostgresql.php');
require_once('birtfiller.php');

//get info from jumi
if (!empty($jumi)){
      	foreach ($jumi as $key => $value) {
			$rptdesign=$value;
			}
		}else{
       		echo "<p>empty</p>";
    	}
    	
$myreport=JPATH_BASE."/media/com_projid/reports/".$rptdesign.".rptdesign";

//create object 
$mybirt = new BirtFiller($rptdesign);

// Récupération des paramètres si il y en a de définis
if (isset($mybirt->result[0]->requete_id) AND $mybirt->result[0]->requete_id!="")
{$param = $mybirt->getParam();}else{$param="";}

$export='<a href="index.php?option=com_projid&format=raw&view=birt&file='.$rptdesign.''.$param.'&out=pdf"><img src="media/com_projid/images/pdf.png" /></a>';
$export.='<a href="index.php?option=com_projid&format=raw&view=birt&file='.$rptdesign.''.$param.'&out=xls"><img src="media/com_projid/images/xls.png" /></a>';

//show the form only if a requete exists
if (isset($mybirt->result[0]->requete_id) AND $mybirt->result[0]->requete_id!="")
{echo $mybirt->setform($export);}

include('html.php');
		

?>
